#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Time          : 2023/3/22 17:52
# File          : my_dict.py
# @Author       : MingTai
# @Department   : platform_qa
# 字典用法训练
import multiprocessing
import os


def dict_my():
    hell_dict = {'name', 'hello', 'vidoe'}

    # Python 3 中字典(Dictionary) has_key() 函数变为 __contains__(key)，用法一样
    if hell_dict.__contains__('name'):
        print(f'包含在内')
    else:
        print(f'包含在内')


def select_cpu():
    # 实际指的是线程数 https://docs.python.org/3/library/multiprocessing.html#multiprocessing.cpu_count
    num = multiprocessing.cpu_count()
    # Return the number of CPUs in the system.
    # This number is not equivalent to the number of CPUs the current process can use.
    print(num)
    print(os.cpu_count())


if __name__ == '__main__':
    select_cpu()
